import os.path
import time
from selenium import webdriver

# 打开浏览器,请求测试网址
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
url = 'file:///' + os.path.abspath('html') + '/upload_file.html'
driver.get(url)

file = os.path.dirname(os.path.abspath(__file__)) + '/geckdrier.log'
# 定位上传标签,输入上传文件
time.sleep(2)
driver.find_element(By.NAME, 'file').send_keys(file)

#退出浏览器
time.sleep(2)
driver.quit()

